home *** CD-ROM | disk | FTP | other *** search
/ Champak 114 / Vol 114.iso / games / beat_the.swf / scripts / DefineSprite_132 / frame_1 / DoAction.as
Encoding:
Text File  |  2010-08-12  |  698 b   |  36 lines

  1. this.init = function()
  2. {
  3.    var _loc2_ = this.attachMovie("mc.number","num_mc",0);
  4.    _loc2_._x = 25;
  5.    var _loc1_ = 0;
  6.    while(_loc1_ < 5)
  7.    {
  8.       _loc2_ = _loc2_.attachMovie("mc.number","num_mc",0);
  9.       if(_loc1_ == 1)
  10.       {
  11.          _loc2_._x = -17;
  12.       }
  13.       else
  14.       {
  15.          _loc2_._x = -12;
  16.       }
  17.       _loc1_ = _loc1_ + 1;
  18.    }
  19.    this.pTotal = 0;
  20. };
  21. this.addPoints = function(tPoints)
  22. {
  23.    var _loc1_ = this;
  24.    _loc1_.pTotal += tPoints * 22;
  25.    if(_loc1_.pTotal < 0)
  26.    {
  27.       _loc1_.pTotal = 0;
  28.    }
  29.    _loc1_.num_mc.setTo(_loc1_.pTotal);
  30. };
  31. this.getScoreTotal = function()
  32. {
  33.    return Math.floor(this.pTotal / 22);
  34. };
  35. this.init();
  36.